package com.ssy.lingxi.logistics.api.feign;

import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.logistics.api.dto.request.CommonIdsRequest;
import com.ssy.lingxi.logistics.api.dto.response.ShipperAddressDetailResponse;
import com.ssy.lingxi.logistics.api.fallback.ShipperAddressFeignFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @menu 内部接口 - 发货地址
 * @author yzc
 * @version 2.0.0
 * @date 2020/7/10
 */
@FeignClient(name = "logistics-service", fallback = ShipperAddressFeignFallback.class)
public interface ShipperAddressControllerFeign {
    /**
     * 发货地址查询
     * @param id 主键id
     * @return 返回结果
     */
    @RequestMapping(value = "/logistics/shipperAddress/feign/get", method = RequestMethod.GET)
    Wrapper<ShipperAddressDetailResponse> getShipperAddress(@RequestParam("id") Long id);

    /**
     * 发货地址查询
     * @param idsRequest 主键id
     * @return 返回结果
     */
    @RequestMapping(value = "/logistics/shipperAddress/feign/list", method = RequestMethod.POST)
    Wrapper<List<ShipperAddressDetailResponse>> listShipperAddress(@RequestBody CommonIdsRequest idsRequest);
}
